package com.example.webwork.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
@Service
public class RedisService {

    @Autowired
    private  StringRedisTemplate redisTemplate;

//    @Autowired
//    public RedisService(StringRedisTemplate redisTemplate) {
//        this.redisTemplate = redisTemplate;
//    }

    public void set(String key, String value) {
        redisTemplate.opsForValue().set(key, value);
    }

    public String get(String key) {
        return redisTemplate.opsForValue().get(key);
    }
}
